import request from '@/router/axios';

// 获取列表
export const getList = (current, size, params) => {
  return request({
    url: '/api/blade-purchase/purchasepaymentinfo/list',
    method: 'get',
    params: {
      ...params,
      current,
      size
    }
  })
}

// 删除
export const remove = (ids) => {
  return request({
    url: '/api/blade-purchase/purchasepaymentinfo/remove',
    method: 'post',
    params: {
      ids
    }
  })
}

//详情
export const detail = (id) => {
  return request({
    url: '/api/blade-purchase/purchasepaymentinfo/detail',
    method: 'get',
    params: {
      id
    }
  })
}

// 保存
export const save = (data) => {
  return request({
    url: '/api/blade-purchase/purchasepaymentinfo/save',
    method: 'post',
    data: data
  })
}

// 启动流程
export const commit = id => {
  return request({
    url: `/api/blade-purchase/purchasepaymentinfo/start-process`,
    method: "post",
    params: { id }
  })
}
// 供应商列表
export const getSupplierList = supplierName => {
  return request({
    url: `/api/blade-purchase/purchasepaymentinfo/supplierList`,
    method: "get",
    params: { supplierName }
  })
}

// 查询供应商是否有正在审批的申请单
export const checkPaymentBySupplierNo = supplierNo => {
  return request({
    url: `/api/blade-purchase/purchasepaymentinfo/checkPaymentBySupplierNo`,
    method: "get",
    params: { supplierNo }
  })
}
